﻿using System.Web.Mvc;
using Dexter.Web.Mvc.Filters;

namespace Dexter.Web.Mvc.Controllers.Backoffice {
	[DexterCallFilter ( false )]
	public class AdminAreaRegistration : AreaRegistration {
		public override string AreaName {
			get { return "Admin"; }
		}

		public override void RegisterArea ( AreaRegistrationContext context ) {
			context.MapRoute ( "MediaFiles" , "Admin/Resources/{action}/{*id}" , new {
				controller = "Home" ,
				action = "Images" ,
				id = UrlParameter.Optional
			} ,
			new string[] { "Dexter.Web.Mvc.Controllers.Backoffice" } );

			context.MapRoute (
				"Admin_Elmah",
				"Admin/Elmah/{id}",
				new { controller = "Elmah", action = "Index", id = UrlParameter.Optional },
				new string[] { "Dexter.Web.Mvc.Controllers.Backoffice" }
				);

			context.MapRoute (
				"Admin_default" ,
				"Admin/{controller}/{action}/{id}" ,
				new { controller = "Home", action = "Index" , id = UrlParameter.Optional} ,
				new string[] { "Dexter.Web.Mvc.Controllers.Backoffice" }
				);

			
			context.MapRoute (
				"Admin_Paged",
				"Admin/{controller}/{action}/Page/{page}",
				new { action = "Index", page = 1 },
				new string[] { "Dexter.Web.Mvc.Controllers.Backoffice" }
			);
		}
	}
}